The list of surfaces passed into the function may be NULL, so don't try
to initialize the surfaces if it is so, to avoid a crash.
Also, remove the cast to GdkPixbuf* for getting surfaces->data, as we
are already using a cairo_surface_t*.
https://bugzilla.gnome.org/show_bug?id=773299
g_return_if_fail (GDK_IS_WINDOW (window));
- if (GDK_WINDOW_DESTROYED (window))
+ if (GDK_WINDOW_DESTROYED (window) || surfaces == NULL)
return;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
small_surface = NULL;
big_diff = 0;
small_diff = 0;
+
while (surfaces)
{
- surface = (GdkPixbuf*) surfaces->data;
+ surface = surfaces->data;
w = cairo_image_surface_get_width (surface);
h = cairo_image_surface_get_height (surface);